package main;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JMenuItem;

import model.trajectory.TargetModel;

public class TargetGridSaveTargetMenuItem extends JMenuItem
{
	private static final long serialVersionUID = 2662610980623155538L;
	public TargetModel target;
	public TargetGridSaveTargetMenuItem(TargetModel target)
	{
		super("Save Trajectory");
		this.target = target;
		this.addActionListener(new SaveTargetActionListener(target));
	}
}

class SaveTargetActionListener implements ActionListener 
{
	private TargetModel target;
	public SaveTargetActionListener(TargetModel target)
	{
		this.target = target;
	}
	
	public void actionPerformed(ActionEvent e) 
	{
		System.out.println(target.saveToText());
	}
}
